#include "Neck.h"


Neck::Neck(int newX,int newY,int newZ,GLUquadricObj *newP, GLint texture_id):Shape(texture_id)
{
	this->x = newX;
	this->y = newY;
	this->z = newZ;
	this->p = newP;
	this->HIP_BASE_RADIUS = 0.5;
	this->HIP_TOP_RADIUS = 0.5;
	this->Angle.xAngle = 0;
	this->Angle.yAngle = 0;
	this->bDrink = false;
	this->Angle.zAngle = 0;
}

void Neck::DrawHip()
{
	if(!this->bDrink)
	{
		glPushMatrix();
		 glColor3f(1, 0.6470, 0);
	glTranslatef(this->x,this->y,this->z);
		//
		glRotatef(this->Anglecord.angle, this->Anglecord.xAngle,this->Anglecord.yAngle,this->Anglecord.zAngle);
		
		//glRotatef(90,1,0,0);
		gluCylinder(p,this->HIP_BASE_RADIUS,this->HIP_TOP_RADIUS,8,10,10);
		glutPostRedisplay();
		glPopMatrix();
	}
	else
	{
		glPushMatrix();
	 glColor3f(1, 0.6470, 0);
		glTranslatef(this->x,this->y-9,this->z);
		
		//glRotatef(this->Anglecord.angle, this->Anglecord.xAngle,this->Anglecord.yAngle,this->Anglecord.zAngle);
		glRotatef(90,1,-1.5,0);
		//glRotatef(-50,0,1,0);
		gluCylinder(p,this->HIP_BASE_RADIUS,this->HIP_TOP_RADIUS,8,10,10);
		glutPostRedisplay();
		glPopMatrix();
	}
}

void Neck::Move()
{
	this->bDrink = !this->bDrink;
}
Neck::~Neck(void)
{
}
